package com.zhouxiaoxuan13.gateway;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * Spring Cloud Gateway 网关应用
 * 提供路由、负载均衡、限流、JWT认证、链路跟踪等功能
 *
 * 功能特性：
 * - JWT认证与权限校验
 * - 动态路由与负载均衡
 * - Zipkin分布式链路跟踪
 * - Redis分布式限流
 * - CORS跨域支持
 * - 全局异常处理
 * - 实时监控与管理
 */
@Slf4j
@SpringBootApplication
@EnableDiscoveryClient
public class CloudGatewayApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(CloudGatewayApplication.class, args);

        String serverPort = context.getEnvironment().getProperty("server.port", "9527");
        String consulHost = context.getEnvironment().getProperty("spring.cloud.consul.host", "localhost");
        String consulPort = context.getEnvironment().getProperty("spring.cloud.consul.port", "8500");
        String zipkinUrl = context.getEnvironment().getProperty("spring.sleuth.zipkin.base-url", "http://localhost:9411");

    }
}
